﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RestSharp;
namespace LearnCrawler
{
	public class RestSharp
	{
		public string HttpGet(string url)
		{
			var client = new RestClient(url);
			client.Timeout = -1;
			var request = new RestRequest(Method.GET);
			IRestResponse response = client.Execute(request);
			return (response.Content);
		}

		public string HttpPost(string url)
		{
			var client = new RestClient(url);
			client.Timeout = -1;
			var request = new RestRequest(Method.POST);
			request.AlwaysMultipartFormData = true;
			request.AddParameter("xh", "TBJU7640509");
			IRestResponse response = client.Execute(request);
			return (response.Content);
		}
		public string TestGetPress(string url)
		{
			var client = new RestClient(url);
			client.Timeout = -1;
			var request = new RestRequest(Method.GET);
			IRestResponse response = client.Execute(request);
			return response.Content;
		}
	}
}
